zetaF <- c(0.9, 0.5, 0.1, 0.01, 0.001, 0.001)
fer <- c(0.01, 0.002, 0.001, 0.0005, 0.00001, 0.000001)
expFer <- exp(fer)
par(mfrow = c(2,1))

plot(fer, zetaF, main ="zeta = f(fer)", las=1, xlim = c(0, 0.02))

erf <- function(x){
	return(2 * pchisq(x * sqrt(2),1) - 1)
}

invTransZeta <- function(x){
	return( 0.5*(1+erf((x-0.0005)/(0.006*sqrt(2)))) )
}

transZeta <- function(x){
	return(0.006*qchisq(x, 2)+0.0005)
}

zetaFunc <- invTransZeta(fer)
abscice <- seq(0, 0.1, 0.0001)
points(abscice, invTransZeta(abscice), type="l", col="red")

print(zetaFunc)
#reg <- lm(zetaF ~ expFer)
#print(summary(reg))
absciceZeta <- seq(0, 1, 0.001)
plot(absciceZeta, transZeta(absciceZeta), type="l", col="darkgreen", main ="zeta = f(zeta)", las=1)

par(mfrow = c(1,1))
